'''
Debugging tools

@author: screwdriver
'''

'''
Version history:
----------------
2009-03-27 screwdriver Created.
2009-03-27 screwdriver Implemented proper debug switch.
'''

import sys

MAJOR_VERSION = 1;
MINOR_VERSION = 0;
MAINTENANCE = 0;

VERSION = [MAJOR_VERSION,".", MINOR_VERSION,".", MAINTENANCE];


_debugToggle = True;

def setDebug(value):
	global _debugToggle;
	_debugToggle = value;

def debug(*values):
	if not _debugToggle: return
	print >> sys.stdout, "DBG>", 
	for v in values: print >> sys.stdout,  v,
	print >> sys.stdout, '.'
	sys.stdout.flush();
